package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface OrderSettingMapper {
    /**
     * 模版下载
     */
    @Select("select * from t_ordersetting")
    List<OrderSetting> download();

    /**
     * 获取记录总数
     * @return
     */
    @Select("select count(*) from t_ordersetting")
    Integer count();
    /**
     * 根据日期修改可预约人数
     */
    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    void editNumberByOrderDate(int number, String orderDate);
    /**
     * 根据年月查询对应的预约设置信息
     */
    @Select("select * from t_ordersetting where orderDate between #{minDate} and #{maxDate}")
    List<OrderSetting> getByDateRange(String minDate, String maxDate);
}
